package com.xsmart.oa.services.mall.commom;

import com.xsmart.common.constant.ResultConstant;
import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.oa.dao.mall.commom.RegionDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RegionService {
    @Autowired
    RegionDao regionDao;

    public ResponseBean getRegionList (RequestBean requestBean) {
        List<Map<String,Object>> regionList = regionDao.getRegionList();
        ResponseBean responseBean = requestBean.getResponseBean();
        if(regionList!=null){
            responseBean.setResult(ResultConstant.SUCCESS);
            responseBean.addResultItem("regionList", regionList);
        }else{
            responseBean.setResult(ResultConstant.USER_PASSWORD_INVALID);
        }
        return responseBean;
    }

}
